package cn.wolfcode.wolf2w.destination;


import cn.wolfcode.wolf2w.common.core.constant.SecurityConstants;
import cn.wolfcode.wolf2w.common.core.constant.ServiceNameConstants;
import cn.wolfcode.wolf2w.common.core.domain.R;
import cn.wolfcode.wolf2w.destination.entity.TaDestination;
import cn.wolfcode.wolf2w.destination.factory.RemoteDestinationFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

/**
* 旅游日记 远程服务
 *
 * @author libai
 * @date 2024-08-02
 */
@FeignClient(contextId = "RemoteDestinationServer", name = ServiceNameConstants.DESTINATION_SERVICE
        , fallbackFactory = RemoteDestinationFallbackFactory.class)
public interface RemoteDestinationService {
    @GetMapping("/destinations/getById/{id}")
    R<TaDestination> getById(@PathVariable("id") Long id);

    @GetMapping("/destinations/feign/list")
    R<List<TaDestination>> list(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
